home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- chooser_gc/--datasheet--
- chooser_gc/--styleguide--
- chooser_gc/CHOOSER_GetClass
- chooser_gc/AllocChooserNodeA
- chooser_gc/FreeChooserNode
- chooser_gc/GetChooserNodeAttrsA
- chooser_gc/SetChooserNodeAttrsA
- chooser_gc/--datasheet-- chooser_gc/--datasheet--
-
- NAME
- chooser_gc -- A popup/dropdown small list selection gadget.
-
- SUPERCLASS
- gadgetclass
-
- REQUIRES
- bevel.image, glyph.image
-
- DESCRIPTION
- A chooser is a small-list selection object. In its inactive mode it
- looks much like a button or cycle gadget. When the button is pressed
- using the mouse, a menu displaying the items in the list is displayed.
-
- The chooser operates in either of two modes, pop-up and drop-down.
- Even though the may operate similarly internally, they are for two
- different functions. Consult the chooser style guide for
- information on how to use these two modes.
-
- Advantages that this class provides:
-
- > Supports window relativity.
-
- > Supports OS 3.0 BOOPSI Gadget HelpTest.
-
- > Cycle2Menu style activation.
-
- > Supports tab-cycle activation and keyboard control.
-
- METHODS
- OM_NEW -- Create the chooser gadget. Passed to superclass.
-
- OM_SET -- Set object attributes. Passed to superclass first.
-
- OM_DISPOSE -- Cancels the chooser menu before being passed to
- superclass.
-
- OM_UPDATE -- Set object notification attributes & render.
- Passed to superclass first.
-
- OM_NOTIFY -- Notify object attributes. Passed to superclass last.
-
- GM_RENDER -- Renders the gadget imagry. Overrides the superclass.
-
- GM_HITTEST -- Determines if mouse is within the gadget rectangle.
- Overrrides the superclass.
-
- GM_GOACTIVE -- Handles activation, pops up the chooser menu.
- Overrides the superclass.
-
- GM_HANDLEINPUT -- Handles input events once active. Overrides the
- superclass.
-
- GM_GOINACTIVE -- Closes the chooser menu. Overrides the superclass.
-
- GM_DOMAIN -- Calculates mix/max sizes. Overrides the superclass.
-
- GM_KEYACTIVE -- Activates gadget via keyboard, advances popup
- selection to the next item, if SHIFT is pressed, it selects
- the previous item. Invoked by window.class only.
-
- GM_KEYINACTIVE -- Deactivates gadget. Invoked by window.class only.
-
- All other methods are passed to the superclass.
-
- ATTRIBUTES
-
- GA_ID (WORD)
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
-
- GA_ReadOnly (BOOL)
- Set to TRUE to make the gadget non-selectable, but without
- a ghost pattern.
-
- Defaults to FALSE.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
-
- GA_Disabled (BOOL)
- Set to TRUE to disable gadget, FALSE otherwise
-
- Defaults to FALSE.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
-
- GA_TextAttr (struct TextAttr *)
- Font to use for the gadget text.
-
- Defaults to the screen's font.
-
- Applicability is (OM_NEW, OM_GET)
-
- CHOOSER_PopUp (BOOL)
- Sets the chooser to work in popup mode.
- Generally this mode is used for selecting an application mode or
- a state from a list of possible values. This item is mutually
- exclusive to CHOOSER_DropDown, one of the two MUST be TRUE.
-
- Defaults to FALSE.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
-
- CHOOSER_DropDown (BOOL)
- Sets the chooser to work in dropdown mode. Generally for
- selecting an action to perform from a list of possible actions.
- This item is mutually exclusive to CHOOSER_PopUp, one of the
- two MUST be TRUE.
-
- Defaults to FALSE.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
-
- CHOOSER_Title (STRPTR)
- Title to appear within the select box when in dropdown mode
-
- Defaults to NULL.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
-
- CHOOSER_Labels (struct List *)
- Exec List of labels. Each node must be allocated with the
- AllocChooserNodeA() function.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
-
- CHOOSER_MaxLabels (WORD)
- Set the maximum number of labels that will be displayed in the
- chooser, regardless of the size of the list.
-
- Defaults to 12.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
-
- CHOOSER_Active (WORD) /* Obsolete */
- CHOOSER_Selected (WORD)
- Index of selected label in the list.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
-
- CHOOSER_Width (WORD)
- The width of the chooser menu.
-
- Defaults to the width of the gadget select box.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
-
- CHOOSER_AutoFit (BOOL)
- Set the width of the chooser menu so that it fits the widest
- label in the list.
-
- Defaults to FALSE.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
- chooser_gc/--styleguide-- chooser_gc/--styleguide--
-
- CHOOSER STYLE
- The Chooser has two very distinct modes of operation, drop-down and
- pop-up. It is important to understand the differences between these
- two modes and to use the proper mode in the proper context.
-
- POP-UP CHOOSERS
- A popup is generally used for setting an application mode or state,
- and in many cases it can replace a cycle gadget or MX (radio buttons)
- gadget. In this mode, there is a currently active item in the list
- of selections, which will be display in the gadget select button.
- This has the same advantage of a cycle menu in that it is compact,
- with the further advantage that all values can be displayed at once
- and therefore the list of values can be much larger, though generally
- no more than a dozen items should be displayed.
-
- DROP-DOWN CHOOSERS
- A dropdown chooser is for performing an action from a list of
- available actions. In this mode, the gadget select box contains a
- title indicating what the actions are for. These actions should all
- be closely related, and specific to a certain context within the
- application. This can be used to replace a group of buttons, or a
- cycle gadget and a button where the cycle gadget modifies the
- behaviour of the button. Since using the chooser in this mode makes
- functions effectively hidden, it should generally only be used where
- compactness is a signficant issue.
-
- An alternate use for a drop-down is to use it as a means of accessing
- a "hot list" for a string or integer gadget. For example, in a word
- processor you might have a string gadget at the top of the screen for
- entering the text point size. Beside that you could have a drop-down
- chooser that lists some common point sizes that would then be copied
- into your integer gadget and change the text size when you make a
- selection. When a drop-down is used this way, it is generally
- desirable not to have the drop-down display a title within the gadget
- box (pass NULL for CHOOSER_Title) and to make the gadget this enough
- so that just the arrow is displayed (use about 20 for GA_Width if not
- using the chooser within a layout group).
- chooser_gc/CHOOSER_GetClass chooser_gc/CHOOSER_GetClass
-
- NAME
- CHOOSER_GetClass -- Gets the pointer to the chooser class.
-
- SYNOPSIS
- chooser_class = CHOOSER_GetClass();
- D0
-
- Class * CHOOSER_GetClass(VOID);
-
- FUNCTION
- This function is only available in runtime linked version of the
- class, and is not in the compiler linker library chooser_gc.lib.
-
- Obtains the pointer to the Chooser gadget class for use with
- NewObject(). This function always returns a valid pointer so
- you do not need to check it. The reason is that if the library
- opens fine, then the pointer returned is already setup. (Of course
- this implies that if opening the library fails, you shouldn't be
- calling this.)
-
- Note that this function does not create the class, that is done
- when the class library is opened.
-
- INPUTS
- Nothing.
-
- RESULT
- chooser_class - Pointer to the Chooser gadget class.
-
- SEE ALSO
- chooser_gc/AllocChooserNodeA chooser_gc/AllocChooserNodeA
-
- NAME
- AllocChooserNodeA -- Allocate a Chooser node.
-
- SYNOPSIS
- struct Node * AllocChooserNode(Tag, ...)
- node = AllocChooserNode(columns, Tag, ...)
-
- struct Node * AllocChooserNodeA(struct TagItem *)
- node = AllocChooserNodeA(taglist)
-
- FUNCTION
- Allocates a node that can be added to the Exec linked list of
- labels in the chooser. This is the only way to allocate a
- node for this list, you cannot allocate nodes yourself because
- the Chooser class uses a private node structure.
-
- INPUTS
- taglist - Attributes for the node, passed onto SetChooserNodeAttrsA().
-
- RESULT
- node - A node that can be added into the Exec list of labels for
- a Chooser gadget.
-
- SEE ALSO
- FreeChooserNode(), SetChooserNodeAttrsA()
- chooser_gc/FreeChooserNode chooser_gc/FreeChooserNode
-
- NAME
- FreeChooserNode -- Free a Chooser node.
-
- SYNOPSIS
- VOID FreeChooserNode(struct Node *)
- FreeChooserNode(node)
-
- FUNCTION
- Frees a ChooserNode allocated with AllocChooserNodeA().
-
- INPUTS
- node - The node to free.
-
- SEE ALSO
- AllocChooserNodeA()
- chooser_gc/GetChooserNodeAttrsA chooser_gc/GetChooserNodeAttrsA
-
- NAME
- GetChooserNodeAttrsA -- Get attributes about a Chooser node.
-
- SYNOPSIS
- VOID GetChooserNodeAttrs(struct Node *, Tag, ...)
- GetChooserNodeAttrs(node, firsttag, ...)
-
- VOID GetChooserNodeAttrsA(struct Node *, struct TagItem *)
- GetChooserNodeAttrsA(node, taglist)
-
- FUNCTION
- The Chooser uses a private node structure and all attributes
- are hidden, and must therefore be accessed with this function.
-
- INPUTS
- node - The Chooser node to get the information on.
- taglist - A tag list of attributes to get. ti_Tag is the attribute
- to get and ti_Data is a pointer to a location to copy the result
- to. The exception is LBNA_Column, which is used to specify a
- column to get attributes on.
-
- SEE ALSO
- SetChooserNodeAttrsA()
- chooser_gc/SetChooserNodeAttrsA chooser_gc/SetChooserNodeAttrsA
-
- NAME
- SetChooserNodeAttrsA -- Set attributes of a Chooser node.
-
- SYNOPSIS
- VOID SetChooserNodeAttrs(struct Node *, Tag, ...)
- SetChooserNodeAttrs(node, firsttag, ...)
-
- VOID SetChooserNodeAttrsA(struct Node *, struct TagItem *)
- SetChooserNodeAttrsA(node, taglist)
-
- FUNCTION
- Changes attributes for a Chooser node. Since the Chooser
- class uses a private node structure, this is the only way to change
- node attributes.
-
- You may NOT change node attributes when the node is in a list
- attached to a Chooser gadget. You must first detach the list
- with CHOOSER_Labels, ~0 before you can change attributes, and
- then re-attach the list.
-
- TAGS
- CNA_Text (STRPTR)
- Text string to appear as a line in the Chooser menu. This tag
- must be supplied for the node.
-
- CNA_Image (struct Image *)
- Image to be placed to the left of the CNA_Text in the Chooser menu.
-
- CNA_SelImage (struct Image *)
- Selected state Image to be placed to the left of the CNA_Text in
- the Chooser menu.
-
- CNA_ReadOnly (BOOL) (V41.4)
- Item will not be highlight rendered when selected.
-
- CNA_Disabled (BOOL) (V41.5)
- Item can not be selected. No GADGETUP message is generated.
-
- CNA_Separator (BOOL) (V41.7)
- Separator (~~~~) Bar Item can not be selected. Simular to the
- separator bars in Intuition menus. No GADGETUP message is generated.
-
- INPUTS
- node - Node whose attributes you are changing.
- taglist - Tag list of attributes to change.
-
- SEE ALSO
- GetChooserNodeAttrsA()
-